<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <base href="<%=request.getContextPath()%>/">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>新增排班</title>
  <link rel="stylesheet" href="statics/css/hisStyle.css">
  <link rel="stylesheet" href="statics/css/common-styles.css">
</head>
<body>
<%@include file="../common/sidebar.jsp"%>
<div class="main-content">
  <%@include file="../common/top.jsp"%>
  <div class="content">
    <div class="function-page">
      <!-- 页面标题 -->
      <div class="page-header">
        <h1>新增排班</h1>
      </div>

      <!-- 错误提示 -->
      <c:if test="${not empty error}">
        <div class="message-error">
            ${error}
        </div>
      </c:if>

      <form action="visit/add" method="post" class="form-container">
        <div class="form-group">
          <label for="deptId">所属科室：</label>
          <select id="deptId" name="deptId" class="form-control" required>
            <option value="">-- 请选择科室 --</option>
            <c:forEach items="${departmentList}" var="department">
              <option value="${department.deptId}">
                  ${department.deptName}
              </option>
            </c:forEach>
          </select>
        </div>
        <div class="form-group">
          <label for="doctorName">医生姓名：</label>
          <input type="text" id="doctorName" name="doctorName" class="form-control" required>
        </div>
        <div class="form-group">
          <label for="visitDate">排班日期：</label>
          <input type="date" id="visitDate" name="visitDate" class="form-control" required>
        </div>
        <div class="form-group">
          <label for="timeSlot">排班时段：</label>
          <select id="timeSlot" name="timeSlot" class="form-control" required>
            <option value="8:00--12:00">8:00--12:00</option>
            <option value="13:30--17:00">13:30--17:00</option>
            <option value="18:00--21:00">18:00--21:00</option>
          </select>
        </div>
        <div class="form-group">
          <label for="maxNum">可预约数量：</label>
          <input type="number" id="maxNum" name="maxNum" class="form-control" min="1" required>
        </div>
        <div class="form-actions">
          <a href="visit/find" class="btn btn-default">取消</a>
          <button type="submit" class="btn btn-primary">保存</button>
        </div>
      </form>
    </div>
  </div>
</div>
</body>
</html>